<?php
require("../../inc/header.php");

/*
		SoftName : EmpireBak Version 2010
		Author   : wm_chief
		Copyright: Powered by www.phome.net
*/

DoSetDbChar('utf8');
E_D("DROP TABLE IF EXISTS `hhs_order_info`;");
E_C("CREATE TABLE `hhs_order_info` (
  `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order_sn` varchar(20) NOT NULL DEFAULT '',
  `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `shipping_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `pay_status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `consignee` varchar(60) NOT NULL DEFAULT '',
  `country` smallint(5) unsigned NOT NULL DEFAULT '0',
  `province` smallint(5) unsigned NOT NULL DEFAULT '0',
  `city` smallint(5) unsigned NOT NULL DEFAULT '0',
  `district` smallint(5) unsigned NOT NULL DEFAULT '0',
  `address` varchar(255) NOT NULL DEFAULT '',
  `zipcode` varchar(60) NOT NULL DEFAULT '',
  `tel` varchar(60) NOT NULL DEFAULT '',
  `mobile` varchar(60) NOT NULL DEFAULT '',
  `email` varchar(60) NOT NULL DEFAULT '',
  `best_time` varchar(120) NOT NULL DEFAULT '',
  `sign_building` varchar(120) NOT NULL DEFAULT '',
  `postscript` varchar(255) NOT NULL DEFAULT '',
  `shipping_id` tinyint(3) NOT NULL DEFAULT '0',
  `shipping_name` varchar(120) NOT NULL DEFAULT '',
  `pay_id` tinyint(3) NOT NULL DEFAULT '0',
  `pay_name` varchar(120) NOT NULL DEFAULT '',
  `how_oos` varchar(120) NOT NULL DEFAULT '',
  `how_surplus` varchar(120) NOT NULL DEFAULT '',
  `pack_name` varchar(120) NOT NULL DEFAULT '',
  `card_name` varchar(120) NOT NULL DEFAULT '',
  `card_message` varchar(255) NOT NULL DEFAULT '',
  `inv_payee` varchar(120) NOT NULL DEFAULT '',
  `inv_content` varchar(120) NOT NULL DEFAULT '',
  `goods_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `shipping_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `insure_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `pay_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `pack_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `card_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `money_paid` decimal(10,2) NOT NULL DEFAULT '0.00',
  `surplus` decimal(10,2) NOT NULL DEFAULT '0.00',
  `integral` int(10) unsigned NOT NULL DEFAULT '0',
  `integral_money` decimal(10,2) NOT NULL DEFAULT '0.00',
  `bonus` decimal(10,2) NOT NULL DEFAULT '0.00',
  `order_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `from_ad` smallint(5) NOT NULL DEFAULT '0',
  `referer` varchar(255) NOT NULL DEFAULT '',
  `add_time` int(10) unsigned NOT NULL DEFAULT '0',
  `confirm_time` int(10) unsigned NOT NULL DEFAULT '0',
  `pay_time` int(10) unsigned NOT NULL DEFAULT '0',
  `shipping_time` int(10) unsigned NOT NULL DEFAULT '0',
  `pack_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `card_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `bonus_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `invoice_no` varchar(255) NOT NULL DEFAULT '',
  `extension_code` varchar(30) NOT NULL DEFAULT '',
  `extension_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `to_buyer` varchar(255) NOT NULL DEFAULT '',
  `pay_note` varchar(255) NOT NULL DEFAULT '',
  `agency_id` smallint(5) unsigned NOT NULL,
  `inv_type` varchar(60) NOT NULL,
  `tax` decimal(10,2) NOT NULL,
  `is_separate` tinyint(1) NOT NULL DEFAULT '0',
  `parent_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `discount` decimal(10,2) NOT NULL,
  `mobile_pay` int(1) unsigned NOT NULL DEFAULT '0',
  `mobile_order` int(1) unsigned NOT NULL DEFAULT '0',
  `team_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0 初始状态 1 正在进行 2 成功 3 失败待退款 4 已退款',
  `team_first` tinyint(4) NOT NULL DEFAULT '0' COMMENT '1 团长 2 团员',
  `team_sign` int(11) DEFAULT NULL COMMENT '一个团拥有相同的值',
  `team_num` int(11) DEFAULT NULL COMMENT '团共需人数',
  `teammen_num` int(11) DEFAULT NULL COMMENT '团现有人数',
  `transaction_id` varchar(50) DEFAULT NULL COMMENT '微信支付订单号',
  `suppliers_id` int(11) NOT NULL DEFAULT '0',
  `msg_code` varchar(20) DEFAULT NULL,
  `settlement_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '订单结算状态',
  `commission` decimal(10,2) DEFAULT '0.00',
  `suppliers_accounts_id` int(11) DEFAULT NULL,
  `wxdesc` varchar(1000) DEFAULT NULL,
  `share_pay_type` tinyint(3) DEFAULT '0',
  `lat` decimal(10,5) DEFAULT NULL,
  `lng` decimal(10,5) DEFAULT NULL,
  `address_type` int(1) unsigned NOT NULL DEFAULT '2',
  `shared_by` int(10) DEFAULT '0' COMMENT '分享者，佣金分成',
  `shared_allow` tinyint(1) DEFAULT '0' COMMENT '是否允许分成',
  `shared_money` decimal(10,2) DEFAULT '0.00' COMMENT '团员佣金',
  `is_sended` tinyint(1) DEFAULT '0' COMMENT '是否已经分过',
  `city_id` int(10) NOT NULL,
  `district_id` int(10) NOT NULL,
  `settlement_sn` varchar(60) DEFAULT NULL COMMENT '订单结算单号',
  `discount_type` int(10) DEFAULT NULL,
  `discount_amount` decimal(10,2) DEFAULT '0.00',
  `refund_sign` tinyint(4) NOT NULL DEFAULT '0',
  `shipping_point` varchar(250) DEFAULT NULL COMMENT '自提点',
  `checked_mobile` varchar(20) DEFAULT NULL COMMENT '自提点预留手机号码',
  `point_id` int(10) DEFAULT NULL,
  `package_one` tinyint(1) DEFAULT '0' COMMENT '团长收包裹',
  `order_type` tinyint(1) DEFAULT '3' COMMENT '1商城，2团购，3零元购',
  `op` varchar(30) DEFAULT NULL COMMENT '核销操作员',
  `op_uid` int(10) DEFAULT '0' COMMENT '操作员id',
  `is_miao` tinyint(1) DEFAULT '0',
  `is_luck` tinyint(1) DEFAULT '0',
  `is_lucker` tinyint(1) DEFAULT '0',
  `luck_times` int(10) DEFAULT '0',
  `goods_id` int(10) DEFAULT '0',
  `wechat_total_fee` int(11) DEFAULT '0',
  `square` varchar(250) DEFAULT NULL COMMENT '广场标语',
  `show_square` tinyint(1) DEFAULT '1' COMMENT '是否显示在广场',
  `is_comm` tinyint(1) DEFAULT '0' COMMENT '是否评价过',
  `fenxiao_money` decimal(10,2) DEFAULT '0.00',
  `is_exchange` tinyint(1) NOT NULL DEFAULT '0',
  `point_shop_remind` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '提货提醒 1 待提醒   2 已提醒',
  `luckdraw_id` int(10) NOT NULL COMMENT '抽奖活动id',
  `is_luckdraw` int(10) NOT NULL DEFAULT '0' COMMENT '是否中奖',
  PRIMARY KEY (`order_id`),
  UNIQUE KEY `order_sn` (`order_sn`),
  KEY `user_id` (`user_id`),
  KEY `order_status` (`order_status`),
  KEY `shipping_status` (`shipping_status`),
  KEY `pay_status` (`pay_status`),
  KEY `shipping_id` (`shipping_id`),
  KEY `pay_id` (`pay_id`),
  KEY `extension_code` (`extension_code`,`extension_id`),
  KEY `agency_id` (`agency_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");

require("../../inc/footer.php");
?>